'''
nums=[1,2,3,4]
target=3
for i in range(0,len(nums)//2):
    for j in range(len(nums)-1,len(nums)//2-1,-1):
        sum=0
        sum=nums[i]+nums[j]
        if sum>0:
            print([i,j],sum)

class Solution:
    def twoSum(nums:list,target:int) -> list:
        for i in range(0,len(nums)):
            for j in range(i+1,len(nums)):
                sum = 0
                sum = nums[i]+nums[j]
                if sum == target:
                    return [i, j]

'''

stones=[1,2,3,4]
while len(stones) > 1:
    stones.sort(reverse=True)
    if stones[0]==stones[1]:
        stones=stones[2:]
        print(stones)
    else:
        stones.append((stones[0]-stones[1]))
        stones=stones[2:]
        print(stones)

